/**
 * @ author: 汪孟苹
 */
define(['jquery','template',
	'scprit/followup/app/specialtyBag/specialtyBag.servers.js',
	'scprit/followup/template/specialtyBag/specialtyBag.tpl.js'],function($,template,$specialtyBagServers,tpl){
	var ui = {};

	/**
	 * 专科袋患者列表
	 */
	var drawList = function(data){
		return template("tpl_specialtyBag_list",data);
	}
	ui.listInit = function(options){
		var data = {
			rows: options.list
		}
		$("#"+options.id).html(tpl.init());
		var h = drawList(data);
		$("#"+options.id).html(h);
	}

	/**
	 * 专科袋患者详细信息info
	 */
	var drawBasicInfo = function(data){
		return template("tpl_specialtyBag_basicInfoCard",data);
	}
	ui.basicInfoInit = function(options){
		$("#"+options.id).html(tpl.init2());
		var h = drawBasicInfo($specialtyBagServers.basicInfoData(options.list));
		$("#"+options.id).html(h);
	}

	/**
	 * 专科袋患者categoryList列表
	 */
	var drawCategoryList= function(data){
		return template("tpl_specialtyBag_categoryList",data);
	}
	ui.categoryListInit = function(options){
		$("#"+options.id).html(tpl.init3());
		var h = drawCategoryList($specialtyBagServers.categoryListData(options.list));
		$("#"+options.id).html(h);
	}

	/**
	 * 专科袋表格头部
	 */
	var drawTableThead = function(data){
		return template("tpl_specialtyBag_thead",data);
	}
	ui.theadInit = function(options){
		var data = {
			rows: options.list
		}
		$("#"+options.id).html(tpl.init4());
		var h = drawTableThead(data);
		$("#"+options.id).html(h);
	}
	/**
	 * 专科袋表格tbody
	 */
	var drawTableTbody = function(data){
		return template("tpl_specialtyBag_tbody",data);
	}
	ui.tbodyInit = function(options){
		$("#"+options.id).html(tpl.init5());
		var h = drawTableTbody($specialtyBagServers.tbodyData(options));
		$("#"+options.id).html(h);
	}

	return ui;
});